
class MyArray<E>{
    public Object [] myArray = new Object[10];
    public void setMyArray(int pos,E val){
        myArray[pos] = val;
    }
    public  E getMyArray(int pos){
        return  (E) myArray[pos];
    }
}
class MyArray1{
    public Object [] myArray = new Object[10];
    public void setMyArray(int pos,Object val){
        myArray[pos] = val;
    }
    public  Object getMyArray(int pos){
        return   myArray[pos];
    }
}
public class Test_1 {
    public static void main0(String[] args) {
        MyArray1 myArray =new MyArray1();
        myArray.setMyArray(0,111);
        Integer a = (Integer) myArray.getMyArray(0);
        System.out.println(a);
        MyArray1 myArray2 =new MyArray1();
        myArray2.setMyArray(1,"111");
        String str = (String) myArray2.getMyArray(1);
        System.out.println(str);
        MyArray<Integer> myArray3 =new MyArray<>();
        myArray3.setMyArray(0,22);
        myArray3.setMyArray(1,11);
        Integer aB =  myArray3.getMyArray(0);
        System.out.println(aB);

    }

    public static void main(String[] args) {

       MyArrayList array = new MyArrayList();
       array.add(1);
       array.add(2);
       array.add(3);
       array.add(4);
      array.display();
       array.add(9,1);
        array.display();


    }
}
